package com.cxrj.zhsq.redCommunity.controller;

import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.cxrj.zhsq.annotation.SystemControllerLog;
import com.cxrj.zhsq.redCommunity.entity.VolunteerMienWithBLOBs;
import com.cxrj.zhsq.redCommunity.service.VolunteerMienService;

/**
 * 志愿者风采
 * @author wangm
 * @created @2018年5月17日-上午9:28:51
 *
 */
@RestController
public class VolunteerMienController {
	
	@Resource
	private VolunteerMienService volunteerMienService;
	
	/**
	 * 查询招募信息列表
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "selectVolunteerMien", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public Map<String, Object> selectVolunteerMien(HttpServletRequest request, HttpServletResponse response) {
		return volunteerMienService.selectVolunteerMienList(request, response);
	}
	
	/**
	 * 根据风采id查询详细信息
	 * @param userId
	 * @return
	 */
	@RequestMapping(value = "selectVolunteerMienById", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public Map<String, Object> selectVolunteerMienById(HttpServletRequest request, HttpServletResponse response) {
		return volunteerMienService.selectVolunteerMienById(request, response);
	}
	
	/**
	 * 添加志愿者风采
	 * 
	 * @return
	 */
	@RequestMapping(value="insertVolunteerMien")
	@SystemControllerLog(description = "添加志愿者风采")
	public Map<String, Object> insertVolunteerMien(VolunteerMienWithBLOBs model, HttpServletRequest request, HttpServletResponse response){
		return volunteerMienService.insertVolunteerMien(model, request, response);
	}
	
	/**
	 * 修改志愿者风采
	 * 
	 * @return
	 */
	@RequestMapping(value = "updateVolunteerMien")
	public Map<String, Object> updateVolunteerMien(VolunteerMienWithBLOBs model, HttpServletRequest request, HttpServletResponse response) {
		return volunteerMienService.updateVolunteerMien(model, request, response);
	}
	
	/**
	 * 根据风采id删除详细信息
	 * @param userId
	 * @return
	 */
	@RequestMapping(value = "deleteVolunteerMien", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public Map<String, Object> deleteVolunteerMien(HttpServletRequest request, HttpServletResponse response) {
		return volunteerMienService.deleteVolunteerMien(request, response);
	}
}
